#include <iostream>
#include <cstring>
using namespace std;

/*
	只要类里面定义了虚函数，这个类以及子类中都会多出一个指针
*/
class Animal
{
public:
	virtual void eat()
	{
		cout<<"动物吃"<<endl;
	}
};

class Cat:public Animal
{
public:
	void eat()
	{
		cout<<"猫吃🐟"<<endl;
	}
};

class Dog:public Animal
{
public:
	void eat()
	{
		cout<<"🐕吃骨头"<<endl;
	}	
};

class Sheep:public Animal
{
public:
	void eat()
	{
		cout<<"🐏吃草"<<endl;
	}	
};



int main(int argc,char **argv)
{
	cout<<"Animal大小: "<<sizeof(Animal)<<endl;
	cout<<"Dog大小: "<<sizeof(Dog)<<endl;
	return 0;	
}